package com.chinasoft.ssm.service;

import com.chinasoft.ssm.pojo.Account;
import com.chinasoft.ssm.pojo.TblAccount;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Transactional;

import java.io.FileNotFoundException;
import java.util.List;

@Transactional(readOnly = false)
public interface AccountService {

    @Transactional  // 支持事务
    void save(TblAccount account);

    @Transactional  // 支持事务
    void delete(Integer id);

    @Transactional  // 支持事务
    void update(TblAccount account);

    List<TblAccount> findAll();

    TblAccount findById(Integer id);

    @Transactional(isolation = Isolation.DEFAULT, rollbackFor = {FileNotFoundException.class})  // 支持事务
    Boolean transfer(String from, String to, Double money) throws FileNotFoundException;

}